<?php 
$dbcnx = new mysqli("216.185.102.20", "darylho","8604923?", "mfidatabase");
/* check connection */
if (mysqli_connect_errno()) {
    printf("Connect failed: %s\n", mysqli_connect_error());
    exit();
}

//variable user to insert into table
$dob=$_POST['DOB'];
$martialstatus=$_POST['MartialStatus'];
$numofchildren=$_POST['NumOfChildren'];
$residentstatus=$_POST['ResidentStatus'];
$employmentstatus=$_POST['EmploymentStatus'];
$grosssalaryp1=$_POST['GrossSalaryP1'];
$occupation=$_POST['Occupation'];
$name = $_POST['Name'];
$id=0;
//$ExistingCustomer=$_POST['pExistingCustomer'];
//$invalidusername = "invalid username";

$stmt = $dbcnx->stmt_init();
	if(!stmt){
		echo "init failed";
	}else{
		$creditscoreinsertquery = "INSERT INTO creditscoresectionD (client_name,d_o_b,martial_status,num_of_children,resident_status,employment_status,
											gross_salary_pone,occupation) VALUES(?,?,?,?,?,?,?,?)";
		
		if($stmt ->prepare($creditscoreinsertquery)){
		$stmt->bind_param('ssssssss',$name,$dob,$martialstatus,$numofchildren,$residentstatus,$employmentstatus,$grosssalaryp1,$occupation);
		$stmt->execute();
		echo "Welcome1, $dob:Welcome2, $martialstatus:Welcome3, $numofchildren:Welcome4, $residentstatus:
		Welcome5, $employmentstatus:Welcome6, $grosssalaryp1:Welcome7, $occupation";
		
		$stmt->close();
	}else{
		echo"fail";
	}
	mysqli_close($dbcnx);
	}
	
?>